<% title _("Host Groups") %>

<% title_actions csv_link, new_link(_("Create Host Group")), help_button %>

<table class="<%= table_css_classes 'table-fixed' %>" data-history-url='<%= hostgroups_path %>'>
  <thead>
    <tr>
      <th><%= sort :label, :as => _('Hostgroup|Name') %></th>
      <th><%= _('Hosts') %></th>
      <th><%= _('Hosts including Sub-groups') %></th>
      <th><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
  <% @hostgroups.each do |hostgroup| %>
    <tr>
      <td>
        <%= label_with_link(hostgroup, 150, authorizer) %>
      </td>
      <td>
        <%= link_to hosts_count[hostgroup], current_hosts_path(:search => %Q[hostgroup_fullname = "#{hostgroup.title}"]) %>
      </td>
      <td>
        <%= link_to hostgroup.children_hosts_count, current_hosts_path(:search => %Q[parent_hostgroup = "#{hostgroup.title}"]) %>
      </td>
      <td>
        <%= hostgroup_actions_dropdown(hostgroup) %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @hostgroups %>
